/* 选文本弹出按钮 
按钮左右两边多余部分问题*/
#popupButton {
    display: none;
    position: absolute;
    background: no-repeat center center;
    background-size: contain;
    border-radius: 3px;
    width: 16px;
    height: 16px;
    padding: 0;
    border: none;
    cursor: pointer;
    z-index: 1000;
}

/* 弹窗整体 */
#customDialog {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    z-index: 1001;
    height: 400px;
    width: 510px;
    max-height: 100%;
    max-width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow: hidden;
}

/* 弹窗内布局 */
#customDialog .dialog-content {
    flex: 0;
    display: flex;
    flex-direction: column;
    height: calc(100% - 5px);
    overflow: hidden;
}

#customDialog .dialog-content p {
    font-size: 16px;
    color: #333;
    margin-bottom: 20px;
}

#customDialog .header {
    flex: 0 0 auto;
}

/* 大模型返回布局 */
#customDialog .main-content {
    flex: 1 1 auto;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: #ccc transparent;
}

#customDialog .main-content h3 {
    margin-top: 0;
    font-size: 20px;
    font-weight: bold;
}

#customDialog .main-content p {
    margin: 0;
}

#customDialog .main-content::-webkit-scrollbar {
    width: 8px;
}

#customDialog .main-content::-webkit-scrollbar-track {
    background: transparent;
}

#customDialog .main-content::-webkit-scrollbar-thumb {
    background-color: #ccc;
    border-radius: 4px;
}

/* 对话框 */
#customDialog .input-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    flex-direction: row;
    margin-top: 10px;
}

#customDialog .input-container input {
    flex: 1;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
    box-sizing: border-box;
    font-size: 16px;
    outline: none;
}

#customDialog .input-container input:focus,
#customDialog .input-container input:-webkit-autofill {
    border: 1px solid #ccc;
    box-shadow: none;
}

/* 中止和发送按钮 */
#sendButton,
#abortButton {
    width: 41.33px;
    height: 41.33px;
    background-size: 100% 100%;
    background-repeat: no-repeat;
    border: none;
    cursor: pointer;
    border-radius: 5px;
    padding: 0;
    margin: 0;
}

/* 处理代码块布局 */
/* #customDialog pre, */
#customDialog code {
    white-space: pre-wrap;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 10px;
    margin: 10px 5px;
    font-family: monospace;
    font-size: 14px;
    border-radius: 5px;
    display: block;
    max-width: calc(100% - 10px);
    background: rgb(250, 250, 250);
    color: rgb(56, 58, 66);
}



/* 全局按钮 */
/* 灰色背景 */
#extension-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    display: none;
}

/* 全局按钮 */
#unique-custom-button {
    position: fixed;
    bottom: 50px;
    right: 20px;
    width: 48px;
    height: 48px;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    z-index: 9998;
    padding: 0;
    overflow: hidden;
    background-color: transparent;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

/* 全局按钮img标签 */
#unique-custom-button img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 弹窗1 */
#custom-dialog-1 {
    position: fixed;
    top: 30%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: white;
    border: 1px solid #ccc;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    z-index: 10000;
    display: none;
    width: 480px;
    height: 177px;
    padding: 16px;
    box-sizing: border-box;
}

/* 对话框头部样式 */
#custom-dialog-1 .dialog-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 16px;
    line-height: 24px;
    padding: 12px 0;
    color: var(--color-text-primary);
    width: 100%;
    margin-bottom: 15px;
}

/* 对话框输入框样式 */
#custom-dialog-1 .dialog-header input {
    flex: 1;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
    box-sizing: border-box;
    font-size: 16px;
    outline: none;
    width: calc(100% - 24px);
}

/* 输入框获得焦点或自动填充时的样式 */
#custom-dialog-1 .dialog-header input:focus,
#custom-dialog-1 .dialog-header input:-webkit-autofill {
    border: 1px solid #ccc;
    box-shadow: none;
}

/* 对话框内容区域样式 */
#custom-dialog-1 .dialog-content {
    margin-top: 16px;
}

/* 总结全文按钮 */
#custom-dialog-1 .dialog-item {
    background-color: #f0f0f0;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    font-size: 16px;
    line-height: 24px;
    padding: 12px;
    color: var(--color-text-primary);
    width: calc(100% - 60px);
    /* 留出发送按钮的宽度和间距 */
    border-radius: 5px;
    cursor: pointer;
    height: 41.33px;
    /* 设置总结全文按钮高度 */
    border: none;
}

/* 文本图标 */
#custom-dialog-1 .dialog-item span.material-icons {
    margin-right: 8px;
    margin-left: 0;
}

/* 弹窗1底部区域的按钮水平排列 */
#custom-dialog-1 .dialog-footer {
    display: flex;
    padding-top: 15px;
    /* 对话框与分割线之间的间距 */
    border-top: 1px solid #eee;
    justify-content: space-between;
    /* 在弹窗尾部，按钮之间有间隔 */
    align-items: center;
    /* 使按钮垂直居中 */
}

/* 弹窗1发送按钮 */
#custom-dialog-1 #send-btn1 {
    width: 41.33px;
    height: 41.33px;
    background-size: 100% 100%;
    background-repeat: no-repeat;
    border: none;
    cursor: pointer;
    border-radius: 5px;
    padding: 0;
    margin: 0;
}



/* 弹窗2 */
#custom-dialog-2 {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: white;
    border: 1px solid #ccc;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    z-index: 10000;
    width: 660px;
    height: 520px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 24px;
    overflow: hidden;
    text-align: left;
}

#custom-dialog-2 .dialog-header,
#custom-dialog-2 .dialog-footer {
    flex-shrink: 0;
    padding: 10px 20px;
    background-color: white;
}

#custom-dialog-2 .dialog-header {
    border-bottom: 1px solid #eee;
}

#custom-dialog-2 .dialog-footer {
    border-top: 1px solid #eee;
    position: absolute;
    bottom: 0;
    width: 100%;
}

#custom-dialog-2 .main-content {
    flex-grow: 1;
    overflow-y: auto;
    padding-bottom: 70px;
    height: 438px;
    width: 100%;
}

#custom-dialog-2 .main-content p {
    margin-bottom: 10px;  
}

#custom-dialog-2 .main-content .user-question {
    margin-top: 10px;
    font-weight: bold;
    font-size: 20px;
}

#custom-dialog-2 .main-content .ai-answer {
    white-space: pre-wrap;
    font-size: 16px;
}

#custom-dialog-2 .input-container {
    display: flex;
    gap: 10px;
    align-items: center;
    padding: 10px 20px;
}

#custom-dialog-2 #user-input {
    flex-grow: 1;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
}

/* custom-dialog-2 滚轮条样式 */
#custom-dialog-2 .main-content::-webkit-scrollbar {
    width: 8px;
}

#custom-dialog-2 .main-content::-webkit-scrollbar-track {
    background: transparent;
}

#custom-dialog-2 .main-content::-webkit-scrollbar-thumb {
    background-color: #ccc;
    border-radius: 4px;
}

#custom-dialog-2 #send-btn2,
#custom-dialog-2 #stop-btn2 {
    width: 41.33px;
    height: 41.33px;
    background-size: 100% 100%;
    background-repeat: no-repeat;
    border: none;
    cursor: pointer;
    border-radius: 5px;
    padding: 0;
    margin: 0;

} 

#custom-dialog-2 #stop-btn2 {
    display: none;
}
